package java8_28.oop.Javatest_2;

public class Draw {
    private String name;

    public Draw(String name) {
        this.name = name;
    }
    public void draw(Figure figure){
        if (figure instanceof Delta){
            Delta d=(Delta)figure;
            figure.area();
            figure.girth();
        }else if (figure instanceof Circle){
            Circle c=(Circle)figure;
            figure.girth();
            figure.area();
        }else if (figure instanceof Oblong){
            Oblong o=(Oblong)figure;
            figure.area();
            figure.girth();
        }
        System.out.println("面积是"+figure.area()+"周长是"+figure.girth());
    }
}
